gen-proto:
	protoc --go_out=. --go-grpc_out=. proto/*


# server的DATA_SIZE需要设置为worker的n倍，n为WORKER_NUM
run-server:
	MODE=server DATA_SIZE=480 WORKER_NUM=3 go run cmd/main.go
run-worker:
	for i in {0..2} ; do \
		MODE=worker SERVER_ADDR=":8080" WORKER_NUM=3 GRADIENT_SIZE=80 BATCH_SIZE=16 DATA_SIZE=160 WORKER_ID=$$i go run cmd/main.go & \
	done
	wait
build-image:
	docker build -t registry.cn-shanghai.aliyuncs.com/carl-zyc/sim-psapp:amdv1 .
